package com.zzxy.spring12.text;

import com.zzxy.spring12.service.impl.AccountServiceImpl;
import org.apache.commons.dbcp.BasicDataSource;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

public class Text {
    public static void main(String[] args) throws Exception{
        /*BasicDataSource dataSource = new BasicDataSource();
        dataSource.setUrl("jdbc.mysql:///spring12?serverTimezone=UTC");
        dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
        dataSource.setUsername("root");
        dataSource.setPassword("123456");
        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
        jdbcTemplate.update("insert  into t_user values(null, ?,?)","zhangwuji", "123");*/
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans8.xml");
        AccountServiceImpl accountService = (AccountServiceImpl) context.getBean("accountService");
        accountService.transer("jack","rose", 1000);
    }
}
